package com.example.mywike.utils.returnUtils;

/**
 * @Author xiyanqiulvgui
 * @Date 2020/9/6 22:15
 * @Description 返回对象工具类
 * @Version 1.0.0
 */
public class ReturnUtils {

    public static ReturnData success(String returnCode,String returnMsg,Object object){
        return new ReturnData(returnCode,returnMsg,object);
    }

    public static ReturnData success(int returnCode,String returnMsg,Object object){
        return new ReturnData(String.valueOf(returnCode),returnMsg,object);
    }

    public static ReturnData success(Object object){
        return new ReturnData("100","请求成功！",object);

    }
    public static ReturnData success(){
        return new ReturnData("100","请求成功！",null);

    }




    public static ReturnData failure(String returnCode,String returnMsg,Object object){
        return new ReturnData(returnCode,returnMsg,object);
    }

    public static ReturnData failure(String returnCode,String returnMsg){
        return new ReturnData(returnCode,returnMsg,null);
    }

    public static ReturnData failure(int returnCode,String returnMsg){
        return new ReturnData(String.valueOf(returnCode),returnMsg,null);
    }


    public static ReturnData failure(String returnMsg){
        return new ReturnData("201",returnMsg,null);
    }

    public static ReturnData failure(){
        return new ReturnData("201","请求失败！",null);
    }

}
